#include<stdio.h>
#include<unistd.h>
void progress(int now)
{
	int i=0;
	char s[100]={0};
	char s2[4]={'|','/','-','\\'};
	for(i;i<=now&&i<=100;i++)
	{
		printf("\r[%-100s][%3d%%][%c]",s,i,s2[i%4]);
		fflush(stdout);
		s[i]='*';
	}
}
void work()
{
	int all=10000;
	int workspeed=1000;
	int i=0;
	int pro=0;
	for(i;i<=all/workspeed;i++)
	{
	progress(pro*100/all);
	fflush(stdout);
	usleep(200000);
	pro+=workspeed;
	}
}
